﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chain_Responsibility
{
    class Program
    {
        static void Main(string[] args)
        {
            PurchaseHandler manager = new Manager();
            PurchaseHandler director = new Director();
            PurchaseHandler president = new President();
            manager.SetSuccessor(director);
            director.SetSuccessor(president);

            int[] requests = { 2000, 500, 1400, 22000, 180, 3000, 27000, 200 };

            foreach (int request in requests)
            {
                manager.HandleRequest(request);
            }
        }
    }
}
